/*
 * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package top.continew.admin.card.service;

import top.continew.admin.card.model.query.UserWechatRelationQuery;
import top.continew.admin.card.model.req.UserWechatRelationReq;
import top.continew.admin.card.model.resp.UserWechatRelationDetailResp;
import top.continew.admin.card.model.resp.UserWechatRelationResp;
import top.continew.starter.extension.crud.service.BaseService;

import java.util.List;

/**
 * 系统用户微信用户关系业务接口
 *
 * @author floyd
 * @since 2024/12/02 15:41
 */
public interface UserWechatRelationService extends BaseService<UserWechatRelationResp, UserWechatRelationDetailResp, UserWechatRelationQuery, UserWechatRelationReq> {

    void deleteOpenId(List<Long> openIds);

    /**
     * 根据微信openId判断是否已被用户关联
     *
     * @param openId 微信openId
     * @return 是否已关联（true：已关联；false：未关联）
     */
    boolean isUserExists(String openId);

    void bindUser(UserWechatRelationReq req);

    /**
     * 根据userId和微信openId判断是否关联
     *
     * @param req 用户微信关系表对象
     * @return 是否关联（true：是；false：否）
     */
    boolean isRelationExists(UserWechatRelationReq req);
}